package com.tdwyz.fictionmanage.exception;

import com.tdwyz.fictionmanage.pojo.Result;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 异常处理机制
 */
@RestControllerAdvice
public class ExceptionHandler {

    @org.springframework.web.bind.annotation.ExceptionHandler(RuntimeException.class)
    public Result handlerException(RuntimeException e){
        e.printStackTrace();
        return Result.defeat(e.getMessage());
    }
}
